import React from 'react'
import Login from '../views/login'
import Home from '../views/home'
import UserList from '../views/userList'
import BlackList from '../views/blackList'
import RoleList from '../views/roleList'
import AddRole from '../views/addRole'
import ClassList from '../views/classList'
import AddClass from '../views/addClass'
import classThing from '../views/classThing'
import SetStudent from '../views/setStudent'
import AddStudent from '../views/addStudent'
import SetCourse from '../views/setCourse'
import SetTemplate from '../views/setTemplate'
import SetCollege from '../views/setCollege'
import SetScreen from '../views/setScreen'
import Work from '../views/work'
import logList from '../views/logList'
import isLogin from '../util/isLogin'


const routerConfig = [
  {
    path: '/login',
    component: Login
  }, {
    path: '/home',
    component: isLogin(Home),
    children: [{
      path: '/home/work',
      component: isLogin(Work)
    }, {
      path: '/home/user/userList',
      component: isLogin(UserList)
    }, {
      path: '/home/user/blackList',
      component: isLogin(BlackList)
    }, {
      path: '/home/role/roleList',
      component: isLogin(RoleList)
    },
    {
      path: '/home/role/addRole',
      component: isLogin(AddRole
      )
    },
    {
      path: '/home/class/classList',
      component: isLogin(ClassList)
    }
      , {
      path: '/home/class/addClass',
      component: isLogin(AddClass)
    }
      , {
      path: '/home/class/classroom',
      component: isLogin(classThing)
    }, {
      path: '/home/class/log',
      component: isLogin(logList)
    }, {
      path: '/home/student/setStudent',
      component: isLogin(SetStudent)
    }, {
      path: '/home/student/addStudent',
      component: isLogin(AddStudent)
    }, {
      path: '/home/college/setCollege',
      component: isLogin(SetCollege)
    }, {
      path: '/home/course/setCourse',
      component: isLogin(SetCourse)
    }, {
      path: '/home/template/setTemplate',
      component: isLogin(SetTemplate)
    }, {
      path: '/home/screen/setScreen',
      component: isLogin(SetScreen)
    },
    {
      from: '/home',
      to: '/home/work'
    }
    ]
  }, {
    from: '/',
    to: '/login'
  }
]

export default routerConfig